package cn.qn.moudle.user;

import lombok.Data;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.Table;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * @author: Bryant
 * @date: 2019/7/15
 * @description: App注册用户
 */
@Entity(name = "app_user")
@Data
@Table(appliesTo = "app_user", comment = "App注册用户")
public class AppUser implements Serializable {

    private static final long serialVersionUID = 4172939238271551602L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", columnDefinition = "int(11) COMMENT '主键'")
    private Integer id;

    @Column(name = "user_id", columnDefinition = "varchar(20) COMMENT '用户编号'")
    private String userId;

    @Column(name = "user_type", columnDefinition = "char(1) COMMENT '用户类型：0-平台用户、1-普通用户'")
    private String userType;

    @Column(name = "mobile", columnDefinition = "varchar(11) COMMENT '用户手机'")
    private String mobile;

    @Column(name = "login_pass", columnDefinition = "varchar(100) COMMENT '登录密码'")
    private String loginPass;

    @Column(name = "nick_name", columnDefinition = "varchar(20) COMMENT '用户昵称'")
    private String nickName;

    @Column(name = "head_img", columnDefinition = "varchar(100) COMMENT '用户头像'")
    private String headImg;

    @Column(name = "signature", columnDefinition = "varchar(100) COMMENT '个性签名'")
    private String signature;

    @Column(name = "sex", columnDefinition = "char(1) COMMENT '状态：1-男 2-女 3-保密'")
    private String sex;

    @Column(name = "score", columnDefinition = "int(11) COMMENT '会员积分'")
    private Integer score;

    @Column(name = "birthday", columnDefinition = "varchar(20) COMMENT '生日'")
    private String birthday;

    @Column(name = "province_code", columnDefinition = "varchar(20) COMMENT '所在省份'")
    private String provinceCode;

    @Column(name = "city_code", columnDefinition = "varchar(20) COMMENT '所在城市'")
    private String cityCode;

    @Column(name = "area_code", columnDefinition = "varchar(20) COMMENT '所在区'")
    private String areaCode;

    @Column(name = "status", columnDefinition = "char(1) COMMENT '状态：1-正常 0-锁定'")
    private String status;

    @Column(name = "create_time", columnDefinition = "datetime COMMENT '创建时间'")
    @Temporal(TemporalType.TIMESTAMP)
    @CreationTimestamp
    private Date createTime;

    @Column(name = "create_by", columnDefinition = "varchar(20) COMMENT '创建人'")
    private String createBy;

    @Column(name = "update_time", columnDefinition = "datetime COMMENT '修改时间'")
    private Date updateTime;

    @Column(name = "update_by", columnDefinition = "varchar(20) COMMENT '操作人'")
    private String updateBy;

}
